package com.zhengze;

public class Demo12 {
    public static void main(String[] args) {
        String str = "The quick brown fox jumps over the lazy dog.";
        // 4个字符必须要加上()，以进行分组匹配
        // 否则会出错
        String re = "\\s([a-z]{4})\\s";
        String rep_str = str.replaceAll(re, "<b>$1</b>");
        System.out.println(rep_str);
    }
}

// The quick brown fox jumps<b>over</b>the<b>lazy</b>dog.